//
//  Configuration.h
//

#import <Foundation/Foundation.h>

//屏幕宽高
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
#define ScreenHeight [UIScreen mainScreen].bounds.size.height
/** 弱引用 */
#define WEAKSELF __weak typeof(self) weakSelf = self;
//加载图片
#define LoadImage(imageName) [UIImage imageNamed:imageName]
/******************  获取设备相关信息   *******************/
//获取当前版本号
#define BUNDLE_VERSION [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]
//获取当前版本的biuld
#define BIULD_VERSION [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]
//判断设备是否为iphoneX
#define DCIsiPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)

#define iPhoneXR (CGSizeEqualToSize(CGSizeMake(414,896), [UIScreen mainScreen].bounds.size) ?YES: NO)
#define iPhoneXSMax (CGSizeEqualToSize(CGSizeMake(414,896), [UIScreen mainScreen].bounds.size) ?YES: NO)
#define iPhoneXS (CGSizeEqualToSize(CGSizeMake(375,812), [UIScreen mainScreen].bounds.size) ?YES: NO)
#define iPhoneX ((iPhoneXS || iPhoneXR || iPhoneXSMax) ? YES : NO)

#define kiPhone4         ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size): NO)
#define kiPhone5         ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define kiPhone6         ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO)
#define kiPhone6Plus     ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO)

#define IS_IPHONE_X      ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
#define IS_IPHONE_Xr  ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) : NO) || ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1624), [[UIScreen mainScreen] currentMode].size) : NO)
#define IS_IPHONE_Xs     ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
#define IS_IPHONE_Xs_Max ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size): NO)
#define IS_IPHONE_12 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1170, 2532), [[UIScreen mainScreen] currentMode].size): NO)
#define IS_IPHONE_12Mini ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1080, 2340), [[UIScreen mainScreen] currentMode].size): NO)
#define IS_IPHONE_12PM ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1284, 2778), [[UIScreen mainScreen] currentMode].size): NO)

//是否为刘海屏系列
#define KIsBangScreen (IS_IPHONE_X==YES || IS_IPHONE_Xr ==YES || IS_IPHONE_Xs== YES || IS_IPHONE_Xs_Max == YES || IS_IPHONE_12 || IS_IPHONE_12Mini || IS_IPHONE_12PM)

/*状态栏*/
#define kHeight_StatusBar (KIsBangScreen ? 44.0 : 20.0)
/*导航栏*/
#define kHeight_NavBar (KIsBangScreen ? 88.0 : 64.0)
/*选择栏*/
#define kHeight_TabBar (KIsBangScreen ? 83.0 : 49.0)
/*安全高度*/
#define kSafe_Top (KIsBangScreen ? 24.0 : 0.0)
#define kSafe_Bottom (KIsBangScreen ? 34.0 : 0.0)

//设计尺寸 屏幕宽高   1242x2688
#define Design_ScreenWidth 375
#define Design_ScreenHeight 667

//屏幕宽高比例
#define Width_Scale (ScreenWidth/Design_ScreenWidth)
#define Height_Scale (ScreenHeight/Design_ScreenHeight)

//设置字号 按屏幕宽度比例尺
#define FontSetWithWeight(size,w) [UIFont systemFontOfSize:size*Width_Scale weight:w]

/*********字号颜色相关***********/
#define FontSet(size) [UIFont systemFontOfSize:(size*Width_Scale)]

#define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]

#define RGB(r,g,b) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:1.0f]

///主题颜色
#define MainThemeColor RGB(37, 130, 255)

///主背景颜色
#define MainBackColor RGB(249, 249, 249)
///透明颜色
#define Color_Clear UIColor.clearColor
///主黑字体颜色
#define MainBlackTextColor RGB(51, 51, 51)

///主灰字体颜色
#define MainGrayTextColor RGB(119, 119, 119)

///纯色  R=G=B     black -> white
#define MainPureColor(value) RGB(value, value, value)

NS_ASSUME_NONNULL_BEGIN

@interface Configuration : NSObject


///获取当前视图控制器
+(UIViewController *)getCurrentVC;

//是否是第一次进入app
+(BOOL)isFirstEnterApp;


//计算文字宽度 单行
+(float)getLabelWidthWithText:(NSString *)textString withFont:(UIFont *)font;

//计算文字高度 多行
+(float)getLabelHeightWithText:(NSString *)textString withFont:(UIFont *)font withLBWidth:(float)width;


//判断登录状态 如果未登录 就去登录
+(void)judgeLoginStatus;

//去登陆
+(void)loginClick;

//获取当前登录状态
+(BOOL)getLoginStatus;

//数组转json字符串
+(NSString *)arrayToJSONString:(NSArray *)array;


//获取价格展示字符串
+(NSString *)getTotalPriceWithPrice:(float)price withTbPrice:(NSInteger)tbPrice;


///复制到剪切板
+(void)pasteWithString:(NSString *)pasteStr;


@end

NS_ASSUME_NONNULL_END
